package cj.web.kly.service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cj.web.kly.dao.ColumnsDAO;
import cj.web.kly.domain.Columns;

@Service
public class ColumnsService {

	@Autowired
    private ColumnsDAO columnsDAO;
	
	public List<Columns> queryAll(){
		return columnsDAO.queryAll();
	}
	
	/**
	 * 查询
	 * @param columns
	 * @return columnslis;size
	 */
	public Map query(Columns columns){
		Map rep = new HashMap();
		List<Columns> categorylis = columnsDAO.query(columns);
		int size = columnsDAO.querySize(columns); 
		rep.put("columnslis", categorylis);
		rep.put("size", size);
		return rep;
    }
	
	public Columns queryById(int id){
		Columns obj = columnsDAO.queryById(id);
		return obj;
    }
	
	public void create(Columns columns){
		columnsDAO.create(columns);
	}
	
	public void update(Columns columns){
		columnsDAO.update(columns);
	}
	
	public void deleteById(int id){
		columnsDAO.deleteById(id);
	}
}
